<!DOCTYPE html>
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>企业认证注册</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="__PUBLIC__/regionfiles/bootstrap.min.css">
<link rel="stylesheet" href="__PUBLIC__/regionfiles/bootstrap-responsive.min.css">
<link rel="stylesheet" href="__PUBLIC__/regionfiles/matrix-login.css">
<link rel="stylesheet" href="__PUBLIC__/regionfiles/font-awesome.css">
<script type="text/javascript" src="__PUBLIC__/regionfiles/jquery-1.5.1.min.js"></script>
	<link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css" media="all">
	<script src="__PUBLIC__/layui/layui.js"></script>
	<script src="__PUBLIC__/js/function.js" type="text/javascript"></script>
	<script type="text/javascript" src="__PUBLIC__/regionfiles/jquery.tips.js"></script>
</head>
<body  style="width:100px; height:100px; background:url(__PUBLIC__/regionfiles/banner_slide_01.jpg);">
	<div style="width:100%;text-align: center;margin: 0 auto;position: absolute;">
		<!-- 注册 -->
		<div id="windows2" style="">
		<div id="loginbox">
			<form action="admin/editCompany" method="post" name="loginForm" id="loginForm">
				<div class="control-group normal_text">
					<h3>
						企业认证注册
					</h3>
				</div>
				<div class="control-group">
					<div class="controls">
						<div class="main_input_box">
							<span class="add-on bg_lg">
							<i>公司名称</i>
							</span><input type="text" name="companyName" id="companyName" value="" placeholder="请输入公司名称" truetype="textinput" class="textinput">
						</div>
					</div>
				</div>
				<div class="control-group">
					<div class="controls">
						<div class="main_input_box">
							<span class="add-on bg_lg">
							<i>行业</i>
							</span>
							<select id="industry" name="industry" style="width: 346px;">
								<option value="机构组织">机构组织</option>
								<option value="农林牧渔">农林牧渔</option>
								<option value="医药卫生">医药卫生</option>
								<option value="建筑建材">建筑建材</option>
								<option value="冶金矿产">冶金矿产</option>
								<option value="信息产业">信息产业</option>
								<option value="机械机电">机械机电</option>
							</select>
						</div>
					</div>
				</div>
				<div class="control-group">
					<div class="controls">
						<div class="main_input_box">
							<span class="add-on bg_lg">
							<i>组织代码</i>
							</span><input type="text" name="orgCode" id="orgCode" value="" placeholder="请输入组织代码" truetype="textinput" class="textinput_hover">
						</div>
					</div>
				</div>
				<div class="control-group">
					<div class="controls">
						<div class="main_input_box" style="margin-left: -240px;">
							<input type="hidden" id="demand" name="demand">
							<div class="layui-upload">
								<span class="add-on bg_lg" >
							<i>营业执照</i>
							</span>
								<button type="button" class="layui-btn" id="test1">上传图片</button>
								<div class="layui-upload-list">
									<img class="layui-upload-img" id="demo1">
									<p id="demoText"></p>
								</div>
							</div>

						</div>
					</div>
				</div>
				<div class="control-group">
					<div class="controls">
						<div class="main_input_box">
							<span class="add-on bg_lg">
							<i>详细地址</i>
							</span><input type="text" name="address" id="address" value="" placeholder="请输入详细地址" truetype="textinput" class="textinput_hover">
						</div>
					</div>
				</div>
				<div class="control-group">
					<div class="controls">
						<div class="main_input_box">
							<span class="add-on bg_lg">
							<i>负责人姓名</i>
							</span><input type="text" name="chargerName" id="chargerName" value="" placeholder="请输入姓名" truetype="textinput" class="textinput_hover">
						</div>
					</div>
				</div>
				<div class="control-group">
					<div class="controls">
						<div class="main_input_box">
							<span class="add-on bg_lg">
							<i>联系电话</i>
							</span><input type="text" name="tel" id="tel" value="" placeholder="请输入联系电话" truetype="textinput" class="textinput_hover">
						</div>
					</div>
				</div>
				<div class="control-group">
					<div class="controls">
						<div class="main_input_box">
							<span class="add-on bg_lg">
							<i>邮箱</i>
							</span><input type="text" name="email" id="email" value="" placeholder="请输入邮箱" truetype="textinput" class="textinput">
						</div>
					</div>
				</div>
				<div class="form-actions">
					<div style="width:86%;padding-left:8%;">
						<span class="pull-right" style="padding-right:3%;"><a href="__APP__/index?login=1" class="btn btn-success">取消</a></span>
						<span class="pull-right"><a onclick="register();" class="flip-link btn btn-info" id="to-recover">提交</a></span>
					</div>
				</div>
			</form>

		</div>
		</div>
		
	</div>


	<script type="text/javascript">
	//注册
	function rcheck(){
		if($("#companyName").val()==""){
			$("#companyName").tips({
				side:3,
	            msg:'输入公司名称',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#companyName").focus();
			$("#companyName").val('');
			return false;
		}else{
			$("#companyName").val(jQuery.trim($('#companyName').val()));
		}

		if($("#demand").val()==""){
			$("#test1").tips({
				side:3,
	            msg:'上传营业执照',
	            bg:'#AE81FF',
	            time:3
	        });
			$("#test1").focus();
			return false;
		}
        if($("#chargerName").val()==""){
            $("#chargerName").tips({
                side:3,
                msg:'输入姓名',
                bg:'#AE81FF',
                time:3
            });
            $("#chargerName").focus();
            return false;
        }
        if($("#tel").val()==""){
            $("#tel").tips({
                side:3,
                msg:'输入联系电话',
                bg:'#AE81FF',
                time:3
            });
            $("#tel").focus();
            return false;
        }

		if($("#email").val()==""){
			$("#email").tips({
				side:3,
	            msg:'输入邮箱',
	            bg:'#AE81FF',
	            time:3
	        });
			$("#email").focus();
			return false;
		}else if(!ismail($("#email").val())){
			$("#email").tips({
				side:3,
	            msg:'邮箱格式不正确',
	            bg:'#AE81FF',
	            time:3
	        });
			$("#email").focus();
			return false;
		}

		return true;
	}
	
	//提交注册
	function register(){
		if(rcheck()){
            $.post("__APP__/admin/editCompany",{
                chargerName:$("#chargerName").val(),
                companyName:$("#companyName").val(),
                address:$("#address").val(),
                orgCode:$("#orgCode").val(),
                tel:$("#tel").val(),
                industry:$("#industry").val(),
                email:$("#email").val(),
                demand:$("#demand").val()
            }, function(data) {
                var str=data.msg;
                if(str==1){
                    alert("认证成功！");
                    window.location.href='__APP__/index?login=1';
				}
            },"json");
		}
	}
	
	//邮箱格式校验
	function ismail(mail){
		return(new RegExp(/^(?:[a-zA-Z0-9]+[_\-\+\.]?)*[a-zA-Z0-9]+@(?:([a-zA-Z0-9]+[_\-]?)*[a-zA-Z0-9]+\.)+([a-zA-Z]{2,})+$/).test(mail));
	}
	//js  日期格式
	</script>

